import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';

class Application {

  static late FluroRouter router;

  // 有跳转默认值
  Future navigatePushToPage(BuildContext context, String route, Map map) {
    var path = StringBuffer();
    path = path
      ..write(route)
      ..write('?');
    if (map.isNotEmpty) {
      map.forEach((key, value) {
        path
          ..write(key)
          ..write('=')
          ..write('${Uri.encodeComponent('$value')}')
          ..write('&');
      });
    }
    print(path);
    return router.navigateTo(context, path.toString(),
        transition: TransitionType.material);
  }
}
